package main
import "fmt"

func intSeq() func() int{

	i := 0
	return func() int{
		i+= 1
		return i
	}
}

func intSeqwithArg( num int) func() int{
	return func() int{
		num += 1
		return num
	}
}

func main(){
	nextInt := intSeq()
	fmt.Printf("%v\n", nextInt)
	fmt.Println(nextInt())
	fmt.Println(nextInt())
	fmt.Println(nextInt())
	newInt := intSeq()
	fmt.Println(newInt())

	newIntwa := intSeqwithArg(5)
	fmt.Println(newIntwa())
}
